using B.S.Medical.Api.Read.Application.Command.Doctor;
using B.S.Medical.Api.Read.DTOS;
using B.S.Medical.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace B.S.Medical.Api.Read.Controllers.Doctor
{
    /// <summary>
    /// 标签控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class LabelController : ControllerBase
    {
        private readonly IMediator mediator;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="mediator">中介者</param>
        public LabelController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 获取标签详情接口
        /// </summary>
        /// <param name="id">标签ID</param>
        /// <returns>返回包装类标签详情</returns>
        [HttpGet]
        public Task<ApiResult<List<LabelDTO>>> GetLabel([FromQuery]GetLabelCommand request)
        {
            return mediator.Send(request);
        }
    }
}